﻿@page "/loginControl"
@using System.Web;
<AuthorizeView>
    <NotAuthorized>
        <div style="height: 100%;">
            <Image Src="背景.png" style="width:100%;height:100%" PreviewVisible="false" Preview="false"></Image>
            <div style="position: fixed;
left: 50%;
top: 50%;
width: 400px;
height: 300px;
margin: -150px 0px 0px -200px;">

                <Card Bordered="true" style="width:100%;background-color:#144d8f;text-align:center;" Hoverable="true">
                    <Body>
                        <label style="text-align: center; color: white; font-size: 20px">@("用户登录")</label>
                        <Divider Style="color:white;background-color:white" />
                        <AntDesign.Input Placeholder="请输入用户名" Size="large" @bind-Value="@Username">
                            <Prefix><Icon Type="user" /></Prefix>
                        </AntDesign.Input>


                        <AntDesign.Input Placeholder="请输入密码" Size="large" @bind-Value="@Password" Type="password">
                            <Prefix><Icon Type="lock" /></Prefix>
                        </AntDesign.Input>

                        @*<a class="ml-md-auto btn btn-primary"
                        href="/login?paramUsername=@encode(@Username)&paramPassword=@encode(@Password)"
                        target="_top">Login</a>*@
                        <a href="/login?paramUsername=@encode(@Username)&paramPassword=@encode(@Password)"> <Button HtmlType="submit" Class="submit" Size="large" Block>登&nbsp;录</Button></a>

                        <Divider Style="color:white;background-color:white" />

                    </Body>
                </Card>
            </div>

        </div>

        @*<input type="text"
        placeholder="User Name"
        @bind="@Username" />
        <input type="password"
        placeholder="Password"
        @bind="@Password" />
        <a class="ml-md-auto btn btn-primary"
        href="/login?paramUsername=@encode(@Username)&paramPassword=@encode(@Password)"
        target="_top">Login</a>*@
    </NotAuthorized>
</AuthorizeView>
@code {
    string Username = "";
    string Password = "";
    private string encode(string param)
    {
        return HttpUtility.UrlEncode(param);
    }
}